﻿package mortal.component.gconst
{
    import Message.Game.*;
    import Message.Public.*;
    import extend.language.*;
    import mortal.game.cache.*;
    import mortal.game.cache.guild.*;
    import mortal.game.manager.*;
    import mortal.game.view.vip.*;

    public class GuildConst extends Object
    {
        public static const WarnDayArr:Array = [0, 3, 5, 7, 15, 30];
        public static const WarnActiviyArr:Array = [0, 20, 30, 40, 50, 60, 70];
        public static const WarnChatArr:Array = [0, 5, 10, 20, 30, 50];
        public static const WarnContributionArr:Array = [0, 5, 10, 15, 20];
        public static const GuildCopyId:int = 302;
        public static const CreateGuildRequireLevel:int = 20;
        public static const CreateGuildRequireCostGold:int = 188;
        public static const inviteCreateGuildRequireTargetPlayerLevel:int = 25;
        public static const MaxGuildNameLength:int = 7;
        public static const MaxPurposeLength:int = 50;
        public static const CanDisbandGuildMembersLimit:int = 10;
        public static const donateResourceCategory:int = 8;
        public static const donateResourceType:int = 8;
        public static const OutgoingPositon:int = 1;
        public static const TransferPositon:int = 2;
        public static const DisbandGuild:int = 3;
        public static const InviteIntoGuild:int = 4;
        public static const ApproveIntoGuild:int = 5;
        public static const ManagerWareHouse:int = 6;
        public static const UpgradeBuilding:int = 7;
        public static const OpenCopy:int = 8;
        public static const DeliverWelfare:int = 9;
        public static const AbsorbBranchMembers:int = 10;
        public static const AppointDeputyLeader:int = 11;
        public static const AppointPrestyer:int = 12;
        public static const AppointLaw:int = 13;
        public static const AppointElite:int = 14;
        public static const KickOutMember:int = 15;
        public static const SetApplyCondition:int = 16;
        public static const ChangePurpose:int = 17;
        public static const Recruit:int = 18;
        public static const UpgradeGuild:int = 19;
        public static const ManagerMembers:int = 20;
        public static const ImpeachLeader:int = 21;
        public static const AntiImpeach:int = 22;
        public static const OpenWareHouse:int = 23;
        public static const SendGuildMail:int = 24;
        public static const UpGradeCamp:int = 25;
        public static const OpenWarnListPanel:int = 26;
        public static const ChangeGuildQQYY:int = 27;
        public static const FindingTalent:int = 28;
        public static const ApplyGuild:int = 29;
        public static const ResourceAllot:int = 30;
        public static const TransferLeader:int = 31;
        public static const OpenDefenceCopy:int = 32;

        public function GuildConst()
        {
            return;
        }// end function

        public static function hasPermissions(param1:int) : Boolean
        {
            if (Cache.instance.guild.selfGuildInfo.selfInfo == null)
            {
                return false;
            }
            var _loc_2:* = Cache.instance.guild.selfGuildInfo.selfInfo.position;
            switch(param1)
            {
                case OutgoingPositon:
                {
                    return _loc_2 >= EGuildPosition._EGuildElite && _loc_2 <= EGuildPosition._EGuildDeputyLeader;
                }
                case TransferPositon:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader;
                }
                case DisbandGuild:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader;
                }
                case InviteIntoGuild:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader || _loc_2 == EGuildPosition._EGuildPresbyter;
                }
                case ApproveIntoGuild:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case ManagerWareHouse:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case UpgradeBuilding:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case OpenCopy:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case DeliverWelfare:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader || _loc_2 == EGuildPosition._EGuildPresbyter;
                }
                case AbsorbBranchMembers:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader || _loc_2 == EGuildPosition._EGuildPresbyter;
                }
                case AppointDeputyLeader:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader;
                }
                case AppointPrestyer:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case AppointLaw:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case AppointElite:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case KickOutMember:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case SetApplyCondition:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader;
                }
                case ChangePurpose:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader;
                }
                case Recruit:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader;
                }
                case UpgradeGuild:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case ManagerMembers:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader || _loc_2 == EGuildPosition._EGuildPresbyter;
                }
                case ImpeachLeader:
                {
                    return _loc_2 == EGuildPosition._EGuildDeputyLeader || _loc_2 == EGuildPosition._EGuildPresbyter;
                }
                case AntiImpeach:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader;
                }
                case OpenWareHouse:
                {
                    return _loc_2 >= EGuildPosition._EGuildMember;
                }
                case SendGuildMail:
                {
                    return _loc_2 >= EGuildPosition._EGuildDeputyLeader;
                }
                case UpGradeCamp:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader;
                }
                case OpenWarnListPanel:
                {
                    return _loc_2 >= EGuildPosition._EGuildDeputyLeader;
                }
                case ChangeGuildQQYY:
                {
                    return _loc_2 >= EGuildPosition._EGuildDeputyLeader;
                }
                case FindingTalent:
                {
                    return _loc_2 >= EGuildPosition._EGuildDeputyLeader;
                }
                case ApplyGuild:
                {
                    return _loc_2 >= EGuildPosition._EGuildPresbyter;
                }
                case ResourceAllot:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                case TransferLeader:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader;
                }
                case OpenDefenceCopy:
                {
                    return _loc_2 == EGuildPosition._EGuildLeader || _loc_2 == EGuildPosition._EGuildDeputyLeader;
                }
                default:
                {
                    break;
                }
            }
            return false;
        }// end function

        public static function get ApplyGoldMinValue() : int
        {
            return 10;
        }// end function

        public static function get ApplyCoinMinValue() : int
        {
            return 5000;
        }// end function

        public static function get DonateGoldMaxValue() : int
        {
            return 10000;
        }// end function

        public static function get CanImpeachLeader() : Boolean
        {
            if (!hasPermissions(ImpeachLeader))
            {
                return false;
            }
            var _loc_1:* = Cache.instance.guild.selfGuildInfo;
            if (_loc_1.memberList.length == 0)
            {
                return false;
            }
            var _loc_2:* = _loc_1.getMemberById(_loc_1.baseInfo.leader.entityId.id);
            if (_loc_2 == null)
            {
                return false;
            }
            if (_loc_2.miniPlayer.online)
            {
                return false;
            }
            var _loc_3:* = _loc_2.lastLogoutDt;
            var _loc_4:* = ClockManager.instance.nowDate;
            var _loc_5:int = 0;
            var _loc_6:* = _loc_4.time - _loc_3.time;
            return _loc_6 >= _loc_5;
        }// end function

        public static function getWareHouseOperTypeName(param1:EGuildWarehouseOper) : String
        {
            switch(param1.value())
            {
                case EGuildWarehouseOper._EGuildWarehouseIn:
                {
                    return Language.getString(20345);
                }
                case EGuildWarehouseOper._EGuildWarehouseOut:
                {
                    return Language.getString(20346);
                }
                case EGuildWarehouseOper._EGuildWarehouseApplyAgree:
                {
                    return Language.getString(20347);
                }
                case EGuildWarehouseOper._EGuildWarehouseApplyRefuse:
                {
                    return Language.getString(20348);
                }
                case EGuildWarehouseOper._EGuildWarehouseAllocation:
                {
                    return Language.getString(20349);
                }
                default:
                {
                    break;
                }
            }
            return "";
        }// end function

        public static function getBuildingNameByType(param1:int) : String
        {
            switch(param1)
            {
                case EGuildStructureType._EGuildHall:
                {
                    return Language.getString(20350);
                }
                case EGuildStructureType._EGuildWareHouse:
                {
                    return Language.getString(20351);
                }
                case EGuildStructureType._EGuildSchool:
                {
                    return Language.getString(20352);
                }
                case EGuildStructureType._EGuildShop:
                {
                    return Language.getString(20353);
                }
                case EGuildStructureType._EGuildTree:
                {
                    return Language.getString(20354);
                }
                case EGuildStructureType._EGuildGarden:
                {
                    return Language.getString(20355);
                }
                case EGuildStructureType._EGuildRewardHall:
                {
                    return Language.getString(20356);
                }
                case EGuildStructureType._EGuildAltar:
                {
                    return Language.getString(20357);
                }
                case EGuildStructureType._EGuildCamp:
                {
                    return Language.getString(20358);
                }
                default:
                {
                    break;
                }
            }
            return "";
        }// end function

        public static function getWarnReasonStr(param1:int) : String
        {
            var _loc_2:* = Cache.instance.guild.selfGuildInfo.warnSetting;
            switch(param1)
            {
                case EReason._EActivity:
                {
                    return Language.getStringByParam(60090, _loc_2.activity);
                }
                case EReason._EChatTimes:
                {
                    return Language.getStringByParam(60091, _loc_2.chatTimes);
                }
                case EReason._EContribution:
                {
                    return Language.getStringByParam(60092, _loc_2.contributionWeek);
                }
                case EReason._EDays:
                {
                    return Language.getStringByParam(60089, _loc_2.days);
                }
                default:
                {
                    break;
                }
            }
            return Language.getString(20359);
        }// end function

        public static function GuildSkillLearnCount() : int
        {
            return 10 + VipUtil.getCurValueByType(EVipRecordType._EVipRecordTypeGuildSkill);
        }// end function

        public static function GuildLearnSkillCategory() : int
        {
            return EProp._EPropProp;
        }// end function

        public static function GuildLearnSkillType() : int
        {
            return EPropType._EPropTypeGuildSchool;
        }// end function

    }
}
